package com.mycompany.app.testsuite.pa;

import org.springframework.orm.hibernate3.HibernateTemplate;

import com.mycompany.app.hr.pa.dao.IEmployeeDao;
import com.mycompany.app.hr.pa.model.Employee;
import com.mycompany.app.testsuite.BaseTestUtils;
import com.mycompany.app.util.SpringUtils;

public class EmployeeTest extends BaseTestUtils {

    public static void main(String[] args) {

        IEmployeeDao dao = (IEmployeeDao) SpringUtils.getApplicationContext()
                .getBean("employeeDao");

        System.out.println(dao.get("397583"));
        dao.get("397583");
        System.out.println(dao.getSuperiors("151309"));

        Employee e = new Employee();
        e.setId("397583");
        e.getBasicInfo().setChineseName("guoxu");

        HibernateTemplate t = (HibernateTemplate) SpringUtils
                .getApplicationContext().getBean("hibernateTemplate");
        t.saveOrUpdate(e); 

    }

}
